<!--用户管理-->
<template>
	<div class="page_rela_container">
		<div class="scroll_auto flex_cell">
			<el-form
				ref="formEl"
				:model="formValue"
				label-width="120px"
				label-position="top"
				style="padding: 0px 10px;"
			>
				<ex_header_spiler title="OMS 站点配置"></ex_header_spiler>
				<web_site_config
					:formValue="formValue.bossWebsiteConfig"
					showMixed
				></web_site_config>

				<ex_header_spiler title="WMS 站点配置"></ex_header_spiler>
				<web_site_config
					:formValue="formValue.wmsWebsiteConfig"
					showDomainMap
				></web_site_config>

				<ex_header_spiler title="TMS 站点配置"></ex_header_spiler>
				<web_site_config :formValue="formValue.tmsWebsiteConfig"></web_site_config>

				<ex_header_spiler title="客户端站点配置"></ex_header_spiler>
				<web_site_config :formValue="formValue.customerWebsiteConfig"></web_site_config>
				<ex_header_spiler title="帮助中心配置"></ex_header_spiler>

				<el-form-item label="帮助中心地址" style="margin: 20px ;">
					<el-input v-model="formValue.helpUrl" style="max-width:400px;"></el-input>
				</el-form-item>
			</el-form>
		</div>
		<div class="page_rela_bottom_area">
			<el-button type="primary" @click="submitForm">保 存</el-button>
		</div>
	</div>
</template>
<script>
import web_site_config from './component/web_site_config.vue'
const _defaultObj = {
	bossWebsiteConfig: {},
	wmsWebsiteConfig: {},
	tmsWebsiteConfig: {},
	customerWebsiteConfig: {},
	helpUrl: ''
}
export default {
	title: 'title_site_config',
	components: { web_site_config },

	data() {
		return {
			formValue: _.cloneDeep(_defaultObj),

			option: {}
		}
	},

	created() {
		this.$ajax({
			url: '/ums-api/user/UserWebsiteRpc/getCfg.json',
			type: 'json',
			success: res => {
				this.formValue = Object.assign(_.cloneDeep(_defaultObj), res.data)
			}
		})
	},

	methods: {
		submitForm() {
			this.$refs['formEl'].validate(valid => {
				if (valid) {
					this.$ajax({
						url: '/ums-api/user/UserWebsiteRpc/saveUpdate.json',
						type: 'json',
						data: this.formValue,
						success: responseData => {
							this.$message({
								showClose: true,
								message: '提交成功',
								type: 'success'
							})
						}
					})
				} else {
					return false
				}
			})
		}
	}
}
</script>
<style></style>
